#!/usr/bin/env python
#--------------------------python-pyturtle--------------04parametri.py--#
#                                                                       #
#                             Poligoni                                  #
#                                                                       #
#--Daniele Zambelli-----------------------------------------------2005--#

from pyturtle import Turtle
tina=Turtle()
tina.delay(0)

def quadratino():
  for i in xrange(4):
    tina.forward(23)
    tina.left(90)

def quadratone():
  for i in xrange(4):
    tina.forward(107)
    tina.left(90)

def quadrato(lato):
  for i in xrange(4):
    tina.forward(lato)
    tina.left(90)

def triangolo(lato):
  for i in xrange(3):
    tina.forward(lato)
    tina.left(120)

def esagono(lato):
  for i in xrange(6):
    tina.forward(lato)
    tina.left(60)

def pentagono(lato):
  for i in xrange(5):
    tina.forward(lato)
    tina.left(72)

def poligono(n, lato):
  for i in xrange(n):
    tina.forward(lato)
    tina.left(360./n)

def poligoni(lato, n):
  for i in xrange(3, n):
    poligono(i, lato)

poligoni(30, 20)

